/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.imenu.ejb;

import com.imenu.entity.ImenuOrder;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Yunzi
 */
@Stateless
public class ImenuOrderFacade extends AbstractFacade<ImenuOrder> {
    @PersistenceContext(unitName = "iMenuPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public ImenuOrderFacade() {
        super(ImenuOrder.class);
    }

    public List<ImenuOrder> findByCustomerId(String customerId) {
        return getEntityManager().createNamedQuery("ImenuOrder.findByCustomerId").setParameter("customerId", customerId).getResultList();
    }
    
}
